package com.maysham.tripod.controller.pub;

import com.maysham.tripod.common.Response;
import com.maysham.tripod.dto.EventQueryRequest;
import com.maysham.tripod.model.Event;
import com.maysham.tripod.service.EventService;
import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/public/event",  produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class EventController {
    @Resource
    private EventService eventService;

    @PostMapping("/query")
    public Response<Page<Event>> query(@RequestBody EventQueryRequest request){
        return Response.ok(eventService.query(request));
    }
}
